package com.zxm;

public class YuHuan implements Handler {
    private Handler handler;
    int number = 0;

    @Override
    public void setNextHandler(Handler handler) {
        this.handler = handler;
    }

    @Override
    public String handlerRequest(int num) {
        if(num == number){
            return "玉环牌最大，玉环是猪！";
        }
        else{
            if (handler != null){
                return handler.handlerRequest(num);
            }
            return null;
        }
    }
}
